$("#submit").click(function () {
    const usr = $("#username");
    const pwd = $("#pwd");
    const promote = $("#promote");
    if (usr.val() === '' || pwd.val() === '') {
        promote.html("输入不可为空~");
        promote.css("visibility", "visible");
        return;
    }
    $.get("/auth",
        {
            username: usr.val(),
            pwd: pwd.val()
        }, (data) => {
            if (data.code === 1) {
                // 存储令牌
                localStorage.setItem('token', data.data);
                // 跳转
                location.href = "/index";
            } else {
                promote.html("用户名或密码错误");
                promote.css("visibility", "visible");
            }
        });

});